package com.example.mapp;

import org.apache.ibatis.annotations.*;

import com.example.entity.UserRegId;

/**
 * Created by douyx on 2017/11/14.
 */
@Mapper
public interface UserRegIdMapp {

	@Insert(" insert into user_reg_id (user_id,register_id) value (#{userId},#{registerId})")
	@SelectKey(statement = "select last_insert_id()", keyProperty = "id", keyColumn = "id", before = false, resultType = Long.class)
	int insert(UserRegId userRegId) throws Exception;

	@Update(" update user_reg_id set register_id=#{registerId} where id=#{id}")
	int update(UserRegId userRegId) throws Exception;

	@Select(" select * from user_reg_id where user_id = #{userId}")
	UserRegId findById(Long id) throws Exception;
}
